package com.service.impl;

import com.bean.ydq.StuInfo;
import com.mapper.ydq.StuStateMapper;
import com.service.StuStateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StuStateServiceImpl implements StuStateService {
    @Autowired
    StuStateMapper stuStateMapper;

    @Override
    public List<StuInfo> getState(Integer interviewerId, String state) {
        return stuStateMapper.getState(interviewerId,state);
    }

    @Override
    public List<StuInfo> gettobeInterviewed(Integer interviewerId, String state) {
        return stuStateMapper.gettobeInterviewed(interviewerId,state);
    }

    @Override
    public List<StuInfo> getPass(Integer interviewerId, String state) {
        return stuStateMapper.getPass(interviewerId,state);
    }

    @Override
    public List<StuInfo> getFailed(Integer interviewerId, String state) {
        return stuStateMapper.getFailed(interviewerId,state);
    }

    @Override
    public List<StuInfo> getAll(Integer interviewerId) {
        return stuStateMapper.getAll(interviewerId);
    }

    @Override
    public String updataStu(Integer stuId, String groups, String intJob) {
        try {
            stuStateMapper.updateStu(stuId,groups,intJob);
            return "修改成功";
        }catch (Exception e){
            return ("修改失败:\n"+e);
        }
    }

    @Override
    public List<StuInfo> getAllStu(String state) {
        return stuStateMapper.getAllStu(state);
    }
}
